package cn.hnucm.vo;

import cn.hnucm.bean.TbUserBasicMessage;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author:liweihua
 * @Description: 后端传给前端最基本的信息
 * @Date: 18:03$ 2021/12/17/017$
 * @Modified:
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserInfo {
    //用户id
    private int userId;
    //用户登录账号
    private String userAccount;
    //用户手机号码
    private String userMobile;
    //用户创建时间
    private String userCreateTime;
    //用户身份
    private String userIdentity;
    //用户昵称
    private String userUsername;
    //用户头像
    private String userHeadimageurl;
    //用户生日
    private String userBirthDatetime;

    public void init(TbUserBasicMessage tbUserBasicMessage){
        this.userId = tbUserBasicMessage.getUserId();
        this.userAccount = tbUserBasicMessage.getUserAccount();
        this.userMobile = tbUserBasicMessage.getUserMobile();
        this.userCreateTime = tbUserBasicMessage.getUserCreateTime();
        this.userIdentity = tbUserBasicMessage.getUserIdentity();
        this.userUsername = tbUserBasicMessage.getTbUserBasisList().get(0).getUserUsername();
        this.userHeadimageurl = tbUserBasicMessage.getTbUserBasisList().get(0).getUserHeadimageUrl();
        this.userBirthDatetime = tbUserBasicMessage.getTbUserBasisList().get(0).getUserBirthDatetime();
    }
}
